<template>
  <div class="go-back">
    <div class="header">
      <span class="back" @click="goBack"
        ><el-icon><ArrowLeft /></el-icon>返回</span
      >|<span>{{ props.title }}</span>
    </div>
    <el-divider />
  </div>
</template>

<script setup>
import { nextTick } from "vue";
import { useRoute, useRouter } from "vue-router";
const props = defineProps({
  title: {
    type: String,
  },
});
//返回按钮
const router = useRouter();
const goBack = () => {
  nextTick(() => {
    router.go(-1);
  });
};
</script>

<style lang="scss" scoped>
.go-back {
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 25px;
    width: 150px;
    // background-color: red;
    color: #989898;
    .back {
      display: flex;
      align-items: center;
      cursor: pointer;
    }
  }
}
</style>